<%@page import="com.zhiyou.entities.User"%>
<%@page import="java.util.List"%>
<%@page import="com.zhiyou.util.UserUtil"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
</head>
<body>
<%
request.setCharacterEncoding("utf-8");
response.setCharacterEncoding("utf-8");

    int id=Integer.parseInt(request.getParameter("id"));
	UserUtil util=new UserUtil();
	int i = util.deleteUserById(id);
    if(i>0){//
    	List<User> list=util.getAllUsers();
		//把数据放到session中
		session.setAttribute("list", list);
    	//删除成功
    	response.sendRedirect("info.jsp");
    	
    }else{//失败
    	response.sendRedirect("error.jsp");
    }
%>
</body>
</html>